package org.gxuwz.core.service.Impl;

import java.util.List;

import org.gxuwz.core.dao.IUserDao;
import org.gxuwz.core.dao.impl.UserDao;
import org.gxuwz.core.entity.TUser;
import org.gxuwz.core.entity.TUserRole;
import org.gxuwz.core.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service("UserService")
public  class UserService implements IUserService {
	@Autowired
	public IUserDao userDao;
	@Override
	public boolean validateTUser(String userid,String pwd){
		return userDao.validateTUser(userid, pwd);
	}
	@Override
	public String getTUserRole(String userid,String roleid){
		return userDao.getTUserRole(userid, roleid);
	}
	@Override                                               //向数据库写入用户信息
	 public void addTUser(TUser User){
		userDao.saveTUser(User);
	 } 
	@Override                                               //向数据库写入用户角色信息
	 public void addTUserRole(TUserRole UserRole){
		userDao.saveTUserRole(UserRole);
	 }
	@Override
	public List<TUser> UserList() {
		return userDao.UserList();
	}

	@Override
	public List<TUserRole> UserRoleList(){
		return userDao.UserRoleList();
	}
	@Override
	 public TUserRole getRoleId(String userid,String roleid) {
	
		return userDao.getRoleId(userid,roleid);
	}
}
